home *** CD-ROM | disk | FTP | other *** search
- Path: engnews1.Eng.Sun.COM!taumet!clamage
- From: clamage@Eng.sun.com (Steve Clamage)
- Newsgroups: comp.std.c++
- Subject: Re: Returning void
- Date: 22 Feb 1996 20:59:06 GMT
- Organization: Sun Microsystems Inc.
- Approved: clamage@eng.sun.com (comp.std.c++)
- Message-ID: <4gil6k$22t@engnews1.Eng.Sun.COM>
- References: <4gia2l$5og@mulga.cs.mu.OZ.AU>
- Reply-To: clamage@Eng.sun.com
- NNTP-Posting-Host: taumet.eng.sun.com
- Content-Type: text
- X-Nntp-Posting-Host: taumet.eng.sun.com
- Content-Length: 1095
- X-Lines: 27
- Originator: clamage@taumet
-
- In article 5og@mulga.cs.mu.OZ.AU, fjh@munta.cs.mu.OZ.AU (Fergus Henderson) writes:
- >Michael Cook <mcook@cognex.com> writes:
- >
- >>Surely we wouldn't want the standard to allow `void&'.
- >
- >No, after all, that might let a tiny little bit of orthogonality
- >creep into C++, and then who knows what people might want next!
- >
- >;-)
-
- I realize Fergus is kidding, but we should also note that the language
- definition says there are no objects of type void, you can't have
- a function parameter of type void, you can't return an expression
- from a function declared to return void, and you can't dereference
- a void*. In the face of all that, allowing void& would seem kind of
- inconsistent.
-
- I think just asserting that void& is a valid type wouldn't be enough.
- We'd have to address the prohibitions above, and also say how to (or if
- you do) initialize a void& variable, how to (or if you do) pass an argument
- to a void& parameter, and how to return a void& from a function. Then we'd
- have to assess whether the benefits would be worth the extra complication.
-
- ---
- Steve Clamage, stephen.clamage@eng.sun.com
-
-
- [ To submit articles: Try just posting with your newsreader.
- If that fails, use mailto:std-c++@ncar.ucar.edu
- FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
- Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
- Comments? mailto:std-c++-request@ncar.ucar.edu
- ]
-